package easystudy.member;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.RedirectView;

import easystudy.dao.MemberDao;

@Controller
public class DeleteMemberController {
	
	private MemberDao memberDao;
	
	public void setMemberDao(MemberDao memberDao){
		this.memberDao = memberDao;
	}
	
	@RequestMapping(value="/member_delete.me")
	protected ModelAndView doDeleteProcess(HttpServletRequest req, @RequestParam("member_num")int member_num){
	
		memberDao.deleteMember(member_num, 1);
		
		return new ModelAndView(new RedirectView("member_logout.me"));
	}

}
